# create_time:  2021/5/10 16:34
from django.urls import path
from rest_framework import routers
from rest_framework_jwt.views import obtain_jwt_token

from . import views

urlpatterns = [
    path('users/', views.UserView.as_view()),  # 注册用户
    path('usernames/<int:username>/count/', views.UsernameCountView.as_view()),  # 判断用户名是否被占用
    path('mobiles/<int:mobile>/count/', views.MobileCountView.as_view()),  # 判断手机号是否已注册
    # JWT登录
    path('authorizations/', obtain_jwt_token),

    # 获取用户详情
    path('user/', views.UserDetailView.as_view()),
    # 更新邮箱
    path('email/', views.EmailView.as_view()),
    # 验证邮箱
    path('emails/verification/', views.EmailVerifyView.as_view()),
]
router = routers.DefaultRouter()
router.register(r'addresses', views.AddressViewSet, base_name='addresses')
urlpatterns += router.urls
